import React, { Component } from 'react'
import '../assets/style/listInput_c.less';
import { ImagePicker } from 'antd-mobile';

export default class ListInput extends Component {
    render() {
        const { files } = this.props;
        return (
            this.props.types == 'img' ?
                <div className="ListImg">
                    <div className="body">
                        <span>{this.props.text}</span>
                        <ImagePicker
                        files={files}
                        onChange={this.props.onChange}
                        selectable={files.length < 1}
                        accept="image/gif,image/jpeg,image/jpg,image/png"
                        length="1"
                        />
                    </div>
                </div>
                :
                <div className="ListInput">
                    <div className="body">
                        <span>{this.props.text}</span>
                        <input onChange={this.props.onChange} value={this.props.value} type="text" />
                    </div>
                </div>
        )
    }
}
